package h0731;

import java.util.Scanner;

/**
  * @description 找座位
  * @author 不知名帅哥
  * @date 2024/7/31 21:57
  * @version 1.0
*/
public class FindSeats2 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        char[] chars = sc.nextLine().toCharArray();
        System.out.println(getResult(chars));
    }

    private static int getResult(char[] chars) {
        int ans=0;
        for (int i = 0; i < chars.length; i++) {
            if (chars[i]=='0'){
                boolean isLeftEmpty=i==0||chars[i-1]=='0';
                boolean isRightEmpty=i==chars.length-1||chars[i+1]=='0';
                if (isLeftEmpty&&isRightEmpty){
                    ans++;
                    chars[i]='1';
                    //跳过下一个节点
                    i++;
                }
            }
        }
        return ans;
    }
}
